\doxysection{C\+:/\+Users/\+ASUS/\+Desktop/dm-\/ctrl\+H7-\/balance-\/9025test/modules/algorithm/user\+\_\+lib.h File Reference}
\hypertarget{user__lib_8h}{}\label{user__lib_8h}\index{C:/Users/ASUS/Desktop/dm-\/ctrlH7-\/balance-\/9025test/modules/algorithm/user\_lib.h@{C:/Users/ASUS/Desktop/dm-\/ctrlH7-\/balance-\/9025test/modules/algorithm/user\_lib.h}}
{\ttfamily \#include "{}stdint.\+h"{}}\newline
{\ttfamily \#include "{}main.\+h"{}}\newline
{\ttfamily \#include "{}cmsis\+\_\+os.\+h"{}}\newline
{\ttfamily \#include "{}stm32h723xx.\+h"{}}\newline
{\ttfamily \#include "{}arm\+\_\+math.\+h"{}}\newline
\doxysubsubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{user__lib_8h_a3c5aa68336a2fe036789588c7b3ab418}\label{user__lib_8h_a3c5aa68336a2fe036789588c7b3ab418} 
\#define {\bfseries user\+\_\+malloc}~malloc
\item 
\#define \mbox{\hyperlink{user__lib_8h_a5db5d0b2f3a2ac1030f993e79d3dc9a2}{msin}}(x)
\item 
\#define \mbox{\hyperlink{user__lib_8h_abd68eaec469d793b118cf45678e81903}{mcos}}(x)
\item 
\Hypertarget{user__lib_8h_a0f6f918a95712f2a0d948953faa867df}\label{user__lib_8h_a0f6f918a95712f2a0d948953faa867df} 
\#define {\bfseries Mat\+Add}~arm\+\_\+mat\+\_\+add\+\_\+f32
\item 
\Hypertarget{user__lib_8h_ab3fbede304e44c966dd6aefa985529bb}\label{user__lib_8h_ab3fbede304e44c966dd6aefa985529bb} 
\#define {\bfseries Mat\+Subtract}~arm\+\_\+mat\+\_\+sub\+\_\+f32
\item 
\Hypertarget{user__lib_8h_a3c32cf25417d12579a08775d1e1a211c}\label{user__lib_8h_a3c32cf25417d12579a08775d1e1a211c} 
\#define {\bfseries Mat\+Multiply}~arm\+\_\+mat\+\_\+mult\+\_\+f32
\item 
\Hypertarget{user__lib_8h_a903ed5d2ab462bffbfd14735c297ed8c}\label{user__lib_8h_a903ed5d2ab462bffbfd14735c297ed8c} 
\#define {\bfseries Mat\+Transpose}~arm\+\_\+mat\+\_\+trans\+\_\+f32
\item 
\Hypertarget{user__lib_8h_aa0296c5f3462cc09cb5d2543eb367505}\label{user__lib_8h_aa0296c5f3462cc09cb5d2543eb367505} 
\#define {\bfseries Mat\+Inverse}~arm\+\_\+mat\+\_\+inverse\+\_\+f32
\item 
\#define \mbox{\hyperlink{user__lib_8h_aa8cecfc5c5c054d2875c03e77b7be15d}{TRUE}}~1
\item 
\#define \mbox{\hyperlink{user__lib_8h_aa93f0eb578d23995850d61f7d61c55c1}{FALSE}}~0
\item 
\Hypertarget{user__lib_8h_a598a3330b3c21701223ee0ca14316eca}\label{user__lib_8h_a598a3330b3c21701223ee0ca14316eca} 
\#define {\bfseries PI}~3.\+14159265354f
\item 
\#define \mbox{\hyperlink{user__lib_8h_aab129be8d871c1b9f523dc6033ffc622}{VAL\+\_\+\+LIMIT}}(val,  min,  max)
\item 
\#define \mbox{\hyperlink{user__lib_8h_ae79e5e0cf7bb4911f4f997c626319a1f}{ANGLE\+\_\+\+LIMIT\+\_\+360}}(val,  angle)
\item 
\#define \mbox{\hyperlink{user__lib_8h_a52c81679893e3e599e26dfa4c3fd0027}{ANGLE\+\_\+\+LIMIT\+\_\+360\+\_\+\+TO\+\_\+180}}(val)
\item 
\#define \mbox{\hyperlink{user__lib_8h_a1a99c32885eaf01f3ef345ebce4abfac}{VAL\+\_\+\+MIN}}(a,  b)
\item 
\#define \mbox{\hyperlink{user__lib_8h_aaa25553cfba9891fd05ae7a4d42c845a}{VAL\+\_\+\+MAX}}(a,  b)
\item 
\#define \mbox{\hyperlink{user__lib_8h_adbe8ffdba6d10272f2161be92ba361c6}{rad\+\_\+format}}(Ang)
\end{DoxyCompactItemize}
\doxysubsubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{user__lib_8h_a1201958dad9fa7b3718e9caf24f46e6a}\label{user__lib_8h_a1201958dad9fa7b3718e9caf24f46e6a} 
typedef \mbox{\hyperlink{structarm__matrix__instance__f32}{arm\+\_\+matrix\+\_\+instance\+\_\+f32}} {\bfseries mat}
\end{DoxyCompactItemize}
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{user__lib_8h_a98b0a4aacab442f655779833d2a14f39}\label{user__lib_8h_a98b0a4aacab442f655779833d2a14f39} 
void {\bfseries Mat\+Init} (\mbox{\hyperlink{structarm__matrix__instance__f32}{mat}} \texorpdfstring{$\ast$}{*}m, uint8\+\_\+t row, uint8\+\_\+t col)
\item 
void \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{user__lib_8h_a31afb956339abf0230d4314c847dd971}{zmalloc}} (size\+\_\+t size)
\begin{DoxyCompactList}\small\item\em 返回一块干净的内{\ucr}?,不过仍然需要强制转{\ucr}?为你需要的类型 \end{DoxyCompactList}\item 
\Hypertarget{user__lib_8h_a514ba70430558b3be1f14d8efcb63c12}\label{user__lib_8h_a514ba70430558b3be1f14d8efcb63c12} 
float {\bfseries Sqrt} (float x)
\item 
\Hypertarget{user__lib_8h_a87431b689d43aac354cb571f46cbda1c}\label{user__lib_8h_a87431b689d43aac354cb571f46cbda1c} 
float {\bfseries abs\+\_\+limit} (float num, float Limit)
\item 
\Hypertarget{user__lib_8h_a8e014290d3f9707d1c2d06717e815a8b}\label{user__lib_8h_a8e014290d3f9707d1c2d06717e815a8b} 
float {\bfseries sign} (float value)
\item 
\Hypertarget{user__lib_8h_addb1d67e21b35b36007371974306da4a}\label{user__lib_8h_addb1d67e21b35b36007371974306da4a} 
float {\bfseries float\+\_\+deadband} (float Value, float min\+Value, float max\+Value)
\item 
\Hypertarget{user__lib_8h_a5ec0782bfe3b3aee7181959715f712e3}\label{user__lib_8h_a5ec0782bfe3b3aee7181959715f712e3} 
float {\bfseries float\+\_\+constrain} (float Value, float min\+Value, float max\+Value)
\item 
\Hypertarget{user__lib_8h_a02c2e5959398dfb10b030adb6a467745}\label{user__lib_8h_a02c2e5959398dfb10b030adb6a467745} 
int16\+\_\+t {\bfseries int16\+\_\+constrain} (int16\+\_\+t Value, int16\+\_\+t min\+Value, int16\+\_\+t max\+Value)
\item 
\Hypertarget{user__lib_8h_aafaf777de97f12e5e1b2fca1c5d066aa}\label{user__lib_8h_aafaf777de97f12e5e1b2fca1c5d066aa} 
float {\bfseries loop\+\_\+float\+\_\+constrain} (float Input, float min\+Value, float max\+Value)
\item 
\Hypertarget{user__lib_8h_a9449f18ffb9917d6aa4bd62b31469e9b}\label{user__lib_8h_a9449f18ffb9917d6aa4bd62b31469e9b} 
float {\bfseries theta\+\_\+format} (float Ang)
\item 
\Hypertarget{user__lib_8h_a6a2af78041b11fa202434c8ead5c9560}\label{user__lib_8h_a6a2af78041b11fa202434c8ead5c9560} 
int {\bfseries float\+\_\+rounding} (float raw)
\item 
\Hypertarget{user__lib_8h_a5d815a0a50d880cf901ad6818b1cc5c8}\label{user__lib_8h_a5d815a0a50d880cf901ad6818b1cc5c8} 
float \texorpdfstring{$\ast$}{*} {\bfseries Norm3d} (float \texorpdfstring{$\ast$}{*}v)
\item 
\Hypertarget{user__lib_8h_ae48889bbfdac4869379b604ee7c5a141}\label{user__lib_8h_ae48889bbfdac4869379b604ee7c5a141} 
float {\bfseries Norm\+Of3d} (float \texorpdfstring{$\ast$}{*}v)
\item 
\Hypertarget{user__lib_8h_a2af89a25e04a8378567cd866ba1e801b}\label{user__lib_8h_a2af89a25e04a8378567cd866ba1e801b} 
void {\bfseries Cross3d} (float \texorpdfstring{$\ast$}{*}v1, float \texorpdfstring{$\ast$}{*}v2, float \texorpdfstring{$\ast$}{*}res)
\item 
\Hypertarget{user__lib_8h_a623c2aeb3e6f6a271a1a91f5770c0634}\label{user__lib_8h_a623c2aeb3e6f6a271a1a91f5770c0634} 
float {\bfseries Dot3d} (float \texorpdfstring{$\ast$}{*}v1, float \texorpdfstring{$\ast$}{*}v2)
\item 
\Hypertarget{user__lib_8h_a329f38f9e67ae31ff3fb32ccb50f3b19}\label{user__lib_8h_a329f38f9e67ae31ff3fb32ccb50f3b19} 
float {\bfseries Average\+Filter} (float new\+\_\+data, float \texorpdfstring{$\ast$}{*}buf, uint8\+\_\+t len)
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\begin{DoxyAuthor}{Author}
Wang Hongxi 
\end{DoxyAuthor}
\begin{DoxyVersion}{Version}
V1.\+0.\+0 
\end{DoxyVersion}
\begin{DoxyDate}{Date}
2021/2/18 
\end{DoxyDate}
\begin{DoxyAttention}{Attention}

\end{DoxyAttention}


\label{doc-define-members}
\Hypertarget{user__lib_8h_doc-define-members}
\doxysubsection{Macro Definition Documentation}
\Hypertarget{user__lib_8h_ae79e5e0cf7bb4911f4f997c626319a1f}\index{user\_lib.h@{user\_lib.h}!ANGLE\_LIMIT\_360@{ANGLE\_LIMIT\_360}}
\index{ANGLE\_LIMIT\_360@{ANGLE\_LIMIT\_360}!user\_lib.h@{user\_lib.h}}
\doxysubsubsection{\texorpdfstring{ANGLE\_LIMIT\_360}{ANGLE\_LIMIT\_360}}
{\footnotesize\ttfamily \label{user__lib_8h_ae79e5e0cf7bb4911f4f997c626319a1f} 
\#define ANGLE\+\_\+\+LIMIT\+\_\+360(\begin{DoxyParamCaption}\item[{}]{val}{, }\item[{}]{angle}{}\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{do}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ (val)\ =\ (angle)\ -\/\ (int)(angle);\ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ (val)\ +=\ (\textcolor{keywordtype}{int})(angle)\ \%\ 360;\ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \}\ \textcolor{keywordflow}{while}\ (0)}

\end{DoxyCode}
\Hypertarget{user__lib_8h_a52c81679893e3e599e26dfa4c3fd0027}\index{user\_lib.h@{user\_lib.h}!ANGLE\_LIMIT\_360\_TO\_180@{ANGLE\_LIMIT\_360\_TO\_180}}
\index{ANGLE\_LIMIT\_360\_TO\_180@{ANGLE\_LIMIT\_360\_TO\_180}!user\_lib.h@{user\_lib.h}}
\doxysubsubsection{\texorpdfstring{ANGLE\_LIMIT\_360\_TO\_180}{ANGLE\_LIMIT\_360\_TO\_180}}
{\footnotesize\ttfamily \label{user__lib_8h_a52c81679893e3e599e26dfa4c3fd0027} 
\#define ANGLE\+\_\+\+LIMIT\+\_\+360\+\_\+\+TO\+\_\+180(\begin{DoxyParamCaption}\item[{}]{val}{}\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{do}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ if\ ((val)\ >\ 180)\ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ (val)\ -\/=\ 360;\ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \}\ \textcolor{keywordflow}{while}\ (0)}

\end{DoxyCode}
\Hypertarget{user__lib_8h_aa93f0eb578d23995850d61f7d61c55c1}\index{user\_lib.h@{user\_lib.h}!FALSE@{FALSE}}
\index{FALSE@{FALSE}!user\_lib.h@{user\_lib.h}}
\doxysubsubsection{\texorpdfstring{FALSE}{FALSE}}
{\footnotesize\ttfamily \label{user__lib_8h_aa93f0eb578d23995850d61f7d61c55c1} 
\#define FALSE~0}

boolean fails \Hypertarget{user__lib_8h_abd68eaec469d793b118cf45678e81903}\index{user\_lib.h@{user\_lib.h}!mcos@{mcos}}
\index{mcos@{mcos}!user\_lib.h@{user\_lib.h}}
\doxysubsubsection{\texorpdfstring{mcos}{mcos}}
{\footnotesize\ttfamily \label{user__lib_8h_abd68eaec469d793b118cf45678e81903} 
\#define mcos(\begin{DoxyParamCaption}\item[{}]{x}{}\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{(arm\_cos\_f32(x))}

\end{DoxyCode}
\Hypertarget{user__lib_8h_a5db5d0b2f3a2ac1030f993e79d3dc9a2}\index{user\_lib.h@{user\_lib.h}!msin@{msin}}
\index{msin@{msin}!user\_lib.h@{user\_lib.h}}
\doxysubsubsection{\texorpdfstring{msin}{msin}}
{\footnotesize\ttfamily \label{user__lib_8h_a5db5d0b2f3a2ac1030f993e79d3dc9a2} 
\#define msin(\begin{DoxyParamCaption}\item[{}]{x}{}\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{(arm\_sin\_f32(x))}

\end{DoxyCode}
\Hypertarget{user__lib_8h_adbe8ffdba6d10272f2161be92ba361c6}\index{user\_lib.h@{user\_lib.h}!rad\_format@{rad\_format}}
\index{rad\_format@{rad\_format}!user\_lib.h@{user\_lib.h}}
\doxysubsubsection{\texorpdfstring{rad\_format}{rad\_format}}
{\footnotesize\ttfamily \label{user__lib_8h_adbe8ffdba6d10272f2161be92ba361c6} 
\#define rad\+\_\+format(\begin{DoxyParamCaption}\item[{}]{Ang}{}\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{loop\_float\_constrain((Ang),\ -\/PI,\ PI)}

\end{DoxyCode}
\Hypertarget{user__lib_8h_aa8cecfc5c5c054d2875c03e77b7be15d}\index{user\_lib.h@{user\_lib.h}!TRUE@{TRUE}}
\index{TRUE@{TRUE}!user\_lib.h@{user\_lib.h}}
\doxysubsubsection{\texorpdfstring{TRUE}{TRUE}}
{\footnotesize\ttfamily \label{user__lib_8h_aa8cecfc5c5c054d2875c03e77b7be15d} 
\#define TRUE~1}

boolean true \Hypertarget{user__lib_8h_aab129be8d871c1b9f523dc6033ffc622}\index{user\_lib.h@{user\_lib.h}!VAL\_LIMIT@{VAL\_LIMIT}}
\index{VAL\_LIMIT@{VAL\_LIMIT}!user\_lib.h@{user\_lib.h}}
\doxysubsubsection{\texorpdfstring{VAL\_LIMIT}{VAL\_LIMIT}}
{\footnotesize\ttfamily \label{user__lib_8h_aab129be8d871c1b9f523dc6033ffc622} 
\#define VAL\+\_\+\+LIMIT(\begin{DoxyParamCaption}\item[{}]{val}{, }\item[{}]{min}{, }\item[{}]{max}{}\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{do}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ if\ ((val)\ <=\ (min))\ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ (val)\ =\ (min);\ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ ((val)\ >=\ (max))\ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ (val)\ =\ (max);\ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \}\ \textcolor{keywordflow}{while}\ (0)}

\end{DoxyCode}
\Hypertarget{user__lib_8h_aaa25553cfba9891fd05ae7a4d42c845a}\index{user\_lib.h@{user\_lib.h}!VAL\_MAX@{VAL\_MAX}}
\index{VAL\_MAX@{VAL\_MAX}!user\_lib.h@{user\_lib.h}}
\doxysubsubsection{\texorpdfstring{VAL\_MAX}{VAL\_MAX}}
{\footnotesize\ttfamily \label{user__lib_8h_aaa25553cfba9891fd05ae7a4d42c845a} 
\#define VAL\+\_\+\+MAX(\begin{DoxyParamCaption}\item[{}]{a}{, }\item[{}]{b}{}\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{((a)\ >\ (b)\ ?\ (a)\ :\ (b))}

\end{DoxyCode}
\Hypertarget{user__lib_8h_a1a99c32885eaf01f3ef345ebce4abfac}\index{user\_lib.h@{user\_lib.h}!VAL\_MIN@{VAL\_MIN}}
\index{VAL\_MIN@{VAL\_MIN}!user\_lib.h@{user\_lib.h}}
\doxysubsubsection{\texorpdfstring{VAL\_MIN}{VAL\_MIN}}
{\footnotesize\ttfamily \label{user__lib_8h_a1a99c32885eaf01f3ef345ebce4abfac} 
\#define VAL\+\_\+\+MIN(\begin{DoxyParamCaption}\item[{}]{a}{, }\item[{}]{b}{}\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{((a)\ <\ (b)\ ?\ (a)\ :\ (b))}

\end{DoxyCode}


\label{doc-func-members}
\Hypertarget{user__lib_8h_doc-func-members}
\doxysubsection{Function Documentation}
\Hypertarget{user__lib_8h_a31afb956339abf0230d4314c847dd971}\index{user\_lib.h@{user\_lib.h}!zmalloc@{zmalloc}}
\index{zmalloc@{zmalloc}!user\_lib.h@{user\_lib.h}}
\doxysubsubsection{\texorpdfstring{zmalloc()}{zmalloc()}}
{\footnotesize\ttfamily \label{user__lib_8h_a31afb956339abf0230d4314c847dd971} 
void \texorpdfstring{$\ast$}{*} zmalloc (\begin{DoxyParamCaption}\item[{size\+\_\+t}]{size}{}\end{DoxyParamCaption})}



返回一块干净的内{\ucr}?,不过仍然需要强制转{\ucr}?为你需要的类型 


\begin{DoxyParams}{Parameters}
{\em size} & 分配大小 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void\texorpdfstring{$\ast$}{*} 
\end{DoxyReturn}
